﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LenderClearingHouse;

namespace LCHWinScraper.SiteScrapers
{
	public class ASLVREO : SiteScraper
	{
		public override string Name { get { return "Assesor Information LVREO ONLY"; } }
		public override string Value { get { return "ASLVREO"; } }
		public override string StartUrl { get { return "http://sandgate.co.clark.nv.us/assrrealprop/ParcelDetail.aspx"; } }
		public override string DataUrl { get { return ""; } }
		public override string HtmlContent { get; set; }


		public override void ParseDataProcess()
		{
			string[] apns = ImportDataAccess.getApnLVREOMasterlist();
			var table = ImportDataBuilders.ParcellAppraisal(); //Build main Table
			foreach (string apn in apns)
			{
				string url = string.Format(
				  @"http://sandgate.co.clark.nv.us/assrrealprop/ParcelDetail.aspx?hdnParcel={0}&hdnInstance=pcl7",
				  apn);
				string content = RequestClient.Get(url);

				var table2 = PageScrapes.scrapeParcell(content, apn, true);
				table.Merge(table2);
			}

			ImportDataAccess.BulkCopyLVREOParcellAppraisal(table); //Bulk copy data
		}
	}
}
